package com.lin.tk.service.impl;

import com.lin.tk.entity.User;
import com.lin.tk.mapper.UserMapper;
import com.lin.tk.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MarkerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 作者：lin
 * 功能：
 * 时间：2022/9/10 22:25
 */
@Slf4j
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public void batchInsert(List<User> users) {
        //指定配置的Marker
//        log.error(MarkerFactory.getMarker("DB"),"日志：{}","草泥马",new Exception("你的娃"));
//        log.info("日志：{},{},{},{},{}","草泥马","哇咋Q","喷砸Q","ES","牛逼任务");
//        log.info(MarkerFactory.getMarker("DB"),"日志类型->{},日志标题->{},日志内容->{}","审核消息","安全工作任务审核", JSON.toJSONString(new HashMap<>()));
        log.error(MarkerFactory.getMarker("DB"),"日志类型->{},日志标题->{},日志内容->{}","异常消息","安全工作任务上报异常","错误");
//        int i = userMapper.batchList(users);
//        for (User user : users) {
//            System.out.println("userName = " + user.getUsername() + " , id = " + user.getId());
//        }

    }
}
